<?php
/* this could be done in an iframe with a meta refresh tag and a transition tag.
the ideal aspect of that would be the new ads each time
*/
	$page = 1;
	if (isset($_REQUEST['page']))
		$page = $_REQUEST['page'];
	
	if ($page<1)
		$page = 1;

	$timelinetype = 'home_timeline';
	if (isset($_REQUEST['tlt']))
		$timelinetype = $_REQUEST['tlt'];

	include ("dateformat.php");
?>



<?php
	$access_token = $_SESSION['access_token'];

/* Create a TwitterOauth object with consumer/user tokens. */
	$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']);

	$jsonDecode = $connection->get('statuses/'.$timelinetype, array('page' => $page));
//print_r($jsonDecode);
	$rowOnOff = "rowOff";
?>
<span id="timelinetitle"><?php echo $access_token['screen_name']; ?></span><?php /*&nbsp;&nbsp;<span id="timelinecount"><?php echo count($jsonDecode); ?> tweet results</span>*/ ?>
<hr id="simplehr" />
<?php include ("timeline_entry.php"); ?>
<form action="index.php" method="GET">
<input type="hidden" name="start" value="args" />
<input type="hidden" name="page" value="<?php echo $page-1; ?>" />
<input type="submit" value="newer" id="pagebutton" />
</form>
<form action="index.php" method="GET">
<input type="hidden" name="start" value="args" />
<input type="hidden" name="page" value="<?php echo $page+1; ?>" />
<input type="submit" value="older" id="pagebutton" />
</form>